package com.action;

import java.util.List;

import com.business.BusinessIpml;
import com.dao.Address;
import com.opensymphony.xwork2.ActionSupport;

public class Action extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3836941425899656987L;

	private Address address;
	private List<Address> addresses;
	private BusinessIpml businessIpml;
	
	public Action(){
		businessIpml = new BusinessIpml();
	}

	public Address getAddress() {
		return address;
	}

	public void setAddress(Address address) {
		this.address = address;
	}

	public List<Address> getAddresses() {
		return addresses;
	}

	public void setAddresses(List<Address> addresses) {
		this.addresses = addresses;
	}
	
	public String search(){
		try{
		addresses = businessIpml.listSearchAddress(address.getPostcode(),address.getStreet(),address.getTown());
		}
		catch(Exception e){
			e.printStackTrace();
		}
		return SUCCESS;
	}
}
